package 五月打卡;

/*
 * @author  YxinMiracle
 * @date  2022-05-01 12:30
 * @Gitee: https://gitee.com/yxinmiracle
 */

public class x的平方根 {
    public int mySqrt(int x) {
        double sqrt = Math.sqrt(x);
        return Integer.parseInt(String.valueOf(sqrt).substring(0,String.valueOf(sqrt).indexOf(".")));
    }
}
